<?php

namespace App\Services;

use App\Models\Contract;
use App\Models\Medical;
use Dcat\Admin\Models\Administrator;

/**
 * 员工服务
 *
 * @Author hechengwei
 * @email chichiooo@sina.com
 * @DateTime 2024-04-12
 */
class EmployeeService
{

    /**
     * 判断是否是员工
     *
     * @Author hechengwei
     * @email chichiooo@sina.com
     * @DateTime 2024-04-12
     * @param [type] $code
     * @return boolean
     */
    public static function isEmployee($code)
    {
        $employee = Administrator::where('employee', $code)->where('is_employee', 1)->where('status', 1)->first();
        if (!empty($employee)) {
            return true;
        } else {
            return false;
        }
    }
}
